﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Configuration;


namespace TarreOA.TarreOABLL
{
    public class FindConfigurationPath
    {
        
        private static FindConfigurationPath findConfigurationPath;
        private string netDiskRoot = ConfigurationManager.AppSettings["NetDiskRoot"];
        private string informFIlePath = ConfigurationManager.AppSettings["InformFIlePath"];
        private string diaryFilePath = ConfigurationManager.AppSettings["DiaryFilePath"];
        private string userFileCabinetPath = ConfigurationManager.AppSettings["UserFileCabinetPath"];

        public string InformFilePath
        {
            get { return informFIlePath; }
        }

        public string DiaryFilePath
        {
            get { return diaryFilePath; }
        }

        private Hashtable netDiskRoots = new Hashtable();
        private Hashtable userFileCabinetPaths = new Hashtable();

        public Hashtable NetDiskRoots
        {
            get { return netDiskRoots; }
        }

        public Hashtable UserFileCabinetPaths
        {
            get { return userFileCabinetPaths; }
        }

        public void AddNetDiskRoots(string key, string value)
        {
            this.netDiskRoots.Add(key, this.netDiskRoot + value);
        }

        public void AddUserFileCabinetPaths(string key, string value)
        {
            this.userFileCabinetPaths.Add(key, this.userFileCabinetPath + value);
        }

        private FindConfigurationPath()
        {
        }

        public static FindConfigurationPath instance()
        {
            if (findConfigurationPath == null)
            {
                findConfigurationPath = new FindConfigurationPath();
                return findConfigurationPath;
            }
            else
            {
                return findConfigurationPath;
            }
        }
    }
}
